package com.guanjia.service.impl;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


    //把这个bean 的范围设置成session，表示这bean是会话级别的，  

    public class SessionController {
        private Map<String,Object> map;
        
      //@PostConstruct当bean加载完之后，就会执行init方法，并且将list实例化；  
        @PostConstruct
        public void init(){  
            map = new HashMap<String,Object>();
        }

        public void put(String key,Object value){
            map.put(key,value);
        }

        public Map<String,Object> get(){
            return map;
        }
      
    }  